menu.htmlHTMLudog?åπùΔ£πùΔ£ÅÅ Monkeybread Realbasic plugin - Documentation - Menu

MBS Plugin Documentation

This is the documentation for the Realbasic Plugins from Monkeybreadsoftware.de. You find these plugins and the newest version of this document at http://www.monkeybreadsoftware.de/realbasic inside the plugins section.

This help was last updated on Freitag, 6. September 2002 and covers 2136 items: 126 classes, 2 controls and 583 global functions.

The list of the themes Global methods by category Global methods by name The list of the classes The list of the controls

class Menu

class, Menu Mo, 15. Jul 2002
Mac OS Classic: Works. Mac OS Carbon: Works. Windows: does nothing.
Function: Gives access to a Menu in the menubar.
Example:
dim mb as menuBar
dim m as menu
mb=new menuBar
m=mb.item(2) // second menu
m.bold(1)=true // make it bold

Bold(index as integer) as boolean

property, Menu Mo, 15. Jul 2002
Mac OS Classic: Works. Mac OS Carbon: Works. Windows: -> false.
Function: The Font to use for the menu item.
Example:
dim mb as menuBar
dim m as menu
mb=new menuBar
m=mb.item(2)
m.Bold(1)=true

CommandKey(index as integer) as string

property, Menu Mo, 15. Jul 2002
Mac OS Classic: Works. Mac OS Carbon: Works. Windows: -> "".
Function: The command key code to use with the menu entry.
Example:
dim mb as menuBar
dim m as menu
mb=new menuBar
m=mb.item(2)
m.CommandKey(1)="K"

Condense(index as integer) as boolean

property, Menu Mo, 15. Jul 2002
Mac OS Classic: Works. Mac OS Carbon: Works. Windows: -> "".
Function: The Font to use for the menu item.
Example:
dim mb as menuBar
dim m as menu
mb=new menuBar
m=mb.item(2)
m.Condense(1)=true

Count as integer

property, Menu Mo, 15. Jul 2002
Mac OS Classic: Works. Mac OS Carbon: Works. Windows: -> 0.
Function: The number of items
Example:
dim mb as menuBar
dim m as menu
mb=new menuBar
m=mb.item(2)
msgbox str(m.count)+" items in the second menu."

Encoding(index as integer) as integer

property, Menu Di, 20. Aug 2002
Mac OS Classic: Works. Mac OS Carbon: Works. Windows: -> 0.
Function: The text encoding.
Example: none

Extend(index as integer) as boolean

property, Menu Mo, 15. Jul 2002
Mac OS Classic: Works. Mac OS Carbon: Works. Windows: -> "".
Function: The Font to use for the menu item.
Example:
dim mb as menuBar
dim m as menu
mb=new menuBar
m=mb.item(2)
m.Extend(1)=true

FontName(index as integer) as string

property, Menu Mo, 15. Jul 2002
Mac OS Classic: Works. Mac OS Carbon: Works. Windows: -> "".
Function: The Font to use for the menu item.
Example:
dim mb as menuBar
dim m as menu
mb=new menuBar
m=mb.item(2)
m.FontName(1)="Comic sans ms"

IconResID(index as integer) as integer

property, Menu Mo, 15. Jul 2002
Mac OS Classic: Works. Mac OS Carbon: Works. Windows: -> 0.
Function: The ID of a CICN Resource in use as an icon for the menu entry.
Example:
dim mb as menuBar
dim m as menu
mb=new menuBar
m=mb.item(2)
m.IconResID(1)=257
Notes: ID needs to be in Range between 256 and 511.

Italic(index as integer) as boolean

property, Menu Mo, 15. Jul 2002
Mac OS Classic: Works. Mac OS Carbon: Works. Windows: -> false.
Function: The Font to use for the menu item.
Example:
dim mb as menuBar
dim m as menu
mb=new menuBar
m=mb.item(2)
m.Italic(1)=true

Mark(index as integer) as integer

property, Menu Sa, 27. Jul 2002
Mac OS Classic: Works. Mac OS Carbon: Works. Windows: -> false.
Function: whether to show a mark.
Example:
dim mb as menuBar
dim m as menu
mb=new menuBar
m=mb.item(2)
m.mark(1)=&h12
Notes:
&h00no mark
&h12check mark
&h13diamond mark

Outline(index as integer) as boolean

property, Menu Mo, 19. Aug 2002
Mac OS Classic: Works. Mac OS Carbon: Works. Windows: -> "".
Function: The Font to use for the menu item.
Example:
dim mb as menuBar
dim m as menu
mb=new menuBar
m=mb.item(2)
m.Outline(1)=true
Notes: Seems not to work for popupmenu on Mac OS X 10.1.5.

Shadow(index as integer) as boolean

property, Menu Mo, 19. Aug 2002
Mac OS Classic: Works. Mac OS Carbon: Works. Windows: -> "".
Function: The Font to use for the menu item.
Example:
dim mb as menuBar
dim m as menu
mb=new menuBar
m=mb.item(2)
m.Shadow(1)=true
Notes: Seems not to work for popupmenu on Mac OS X 10.1.5.

Text(index as integer) as string

property, Menu Mo, 15. Jul 2002
Mac OS Classic: Works. Mac OS Carbon: Works. Windows: -> "".
Function: The caption to use with the menu entry.
Example:
dim mb as menuBar
dim m as menu
mb=new menuBar
m=mb.item(2)
m.Text(1)="A nice text"

Underline(index as integer) as boolean

property, Menu Mo, 15. Jul 2002
Mac OS Classic: Works. Mac OS Carbon: Works. Windows: -> "".
Function: The Font to use for the menu item.
Example:
dim mb as menuBar
dim m as menu
mb=new menuBar
m=mb.item(2)
m.Underline(1)=true

MenuBarHeight as Integer

global method, Menu So, 14. Jul 2002
Mac OS Classic: Works. Mac OS Carbon: Works. Windows: returns allways 0.
Function: Returns the height of the menubar in pixels.
Example: msgbox "The menubar is "+str(MenuBarHeight)+" pixels height."
Notes:
Requires the appearance manager.

Without plugin, you can use this:

#if targetCarbon
declare function GetThemeMenuBarHeight lib "CarbonLib" (p as ptr) as integer
#else
declare function GetThemeMenuBarHeight lib "AppearanceLib" (p as ptr) as integer
#endif

dim l as integer
dim p as memoryBlock
p=newmemoryBlock(10)

error=GetThemeMenuBarHeight(p) // 0 if okay.
menuheight=p.short(0) // in pixels. 22 on Mac OS X.

Contact

Written 2002 by Christian Schmitz. Feel free to ask or report mistakes to realbasic@macsw.de.
Thanks.

This resource fork intentionally left blank ˇˇ